<?php
/**
*Smarty plugin
*@Liu Zhongjie
*@Beijing Arouter Co.Ltd
*@2007-2-12
**/

/**
* Smarty {html_hidden} function plugin
*
* Type:    function<br>
* Name:    html_hidden<br>
* Date:    Feb 12,2007<br>
* Input:<br>
*         -name        = Hidden name.(string).
*         -value       = Hidden value.(string).
*
* Examples:
* <pre>
* {html_hidden name="goto" value="{goto}"}
* {html_hidden name="dom" value="{dom}"}
* </pre>
* @param array
* @param Smarty
* @return string
**/

function smarty_function_html_hidden ($params, &$smarty)
{
	require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
	
	$name         = NULL;
    $value        = NULL;
    $extra        = '';
    
    foreach ($params as $_key=>$_value) {
        switch ($_key) {
            case 'name':
            case 'value':
                $$_key = (string)$_value;
                break;

        }
    }
  

    $output = '<input type="hidden" name="'
        . smarty_function_escape_special_chars($name) . '" class="'
        . smarty_function_escape_special_chars($class) . '" ';

    $output .=$extra . ' />' ;
    
    return $output;
}
?>